﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.OleDb;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.ObjectModel;

namespace Adapter.SISCONVE.Pages
{
    public class LoginPage : BasePage
    {
         private const string urlLogin = "https://sisconve.ancap.com.uy/gis/login.aspx";

        private const string usuario = "xpath=//*[@id='txtUsuario']";
        private const string password = "xpath=//*[@id='txtPassword']";
        private const string btnIngresar = "xpath=//*[@id='btnIngresar']";
        
        public LoginPage(Manager manager)
            : base(manager)
        {
        }

        public LoginPage()
        { }


        public void NavigateToPage(string uri)
        {
            GetBrowser().NavigateTo(uri);
            GetBrowser().WaitUntilReady();
        }

        public void Login(string username,string pass)
        {
            NavigateToPage(urlLogin);

            SetText(usuario, username);
            SetText(password, pass);

            Click(btnIngresar);
        }

    }
}
